/**
 *
 * 获取当前时间
 */
function getNowTime() {
    var myDate = new Date();
    //获取当前年
    var year = myDate.getFullYear();
    //获取当前月
    var month = myDate.getMonth() + 1;
    //获取当前日
    var date = myDate.getDate();
    var h = myDate.getHours();       //获取当前小时数(0-23)
    var m = myDate.getMinutes();     //获取当前分钟数(0-59)
    var s = myDate.getSeconds();
    var w = myDate.getDay();
    var today = new Array("星期一","星期二","星期三","星期四","星期五","星期六","星期天");
    var now = year + '年' + getNow(month) + "月" + getNow(date) + " " + getNow(h) + ':' + getNow(m) + ":" + getNow(s) + " "+ today[w-1];
    return now;
}

function getNow(s) {
    return s < 10 ? '0' + s : s;
}

//设置导航栏当前时间
function setNowTime() {
    layui.$('#nav-time').html('当前时间：'+ getNowTime());
}
